import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-bind',
  templateUrl: './bind.component.html',
  styleUrls: ['./bind.component.css']
})
export class BindComponent implements OnInit {
  imgUrl:string = "http://t2.27270.com/uploads/tu/201710/9999/bbbb5fe4df.jpg";
  size: number = 2;
  divClass: string;
  isB:boolean = true;
  dicClass:any = {
    a:false,
    b:false,
    c:false
  };
  name:string;
  isDev:boolean = false;
  divstyle:any = {
    color: 'green',
    background: 'red'
  };

  constructor() {
    setTimeout(() => {
      this.divClass = "c";
      this.isDev = true;
      this.dicClass = {
        a:true,
        b:true,
        c:true
      };
      // this.name = "tom";
      this.divstyle = {
        color: 'green',
        background: 'red'
      };
    },3000)
  }

  ngOnInit() {

  }

  ngOnInput(event){
    this.name = event.target.value;
  }

  doOnclick(event:any) {
    console.log(event);
    console.log(event.clientY);
  }

  doOninput(event:any){
    console.log(event.target.value);
    console.log(event.target.getAttribute('value'));
  }


}
